function h=drawboundary(bnd)
% drawboundary: Draw a specified boundary object
%
% SYNTAX:
%   h = drawboundary(bnd)
%   Return handles of graphics objects representing the boundary.
%   Boundary object bnd should be created with function NEWBOUNDARY.

%   Author: Hongbin Ma
%   Last updated: 2009-6-1 with MATLAB 6.5
%   Problems or suggestions? Email me: mathmhb[at]163.com

h=[];
if isempty(bnd)|isempty(bnd.nodes),
    return;
end;
k=bnd.convhull;
x=bnd.nodes(k,1);
y=bnd.nodes(k,2);
hold on;
h=plot(x,y,bnd.linestyle);
set(h,'LineWidth',bnd.linewidth);
set(h,'Color',bnd.color);

